package cn.itcast.day11.demo08;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;


public class DemoInterface {

    public static void main(String[] args) {

        Random r = new Random();
        System.out.println(r.nextInt());
        //左边是接口名称，右边是实现类名称，这就是多态写法
        List<String> list = new ArrayList<>();

        List<String> result = addNames(list);

        for (int i = 0; i < result.size(); i++) {
            System.out.println(result.get(i));
        }
    }

    public static List<String> addNames(List<String> list){
        list.add("1");
        list.add("2");
        list.add("3");
        return list;
    }
}
